using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace CLZ.Data
{
	public static class TableSuggest
	{
		public const string Table = "Suggest";
		public const string SuggestID = "SuggestID";
		public const string Title = "Title";
		public const string Content = "Content";
		public const string MemberID = "MemberID";
		public const string MemberName = "MemberName";
		public const string CreateDate = "CreateDate";
		public const string IsRead = "IsRead";
		public const string ReadDate = "ReadDate";
		public const string CanReply = "CanReply";
		public const string IsReply = "IsReply";
		public const string ReplyDate = "ReplyDate";
		public const string ReplyWay = "ReplyWay";
	}
	
	[Serializable]
	public class BaseSuggest
		: IDbSessionEntity, IJsonClass
	{
		int m_SuggestID;
		/// <summary>
        /// 
        /// </summary>
        public int SuggestID
        {
            get { return m_SuggestID; }
            set { m_SuggestID = value; }
        }
		
		string m_Title;
		/// <summary>
        /// 标题
        /// </summary>
        public string Title
        {
            get { return m_Title; }
            set { m_Title = value; }
        }
		
		string m_Content;
		/// <summary>
        /// 
        /// </summary>
        public string Content
        {
            get { return m_Content; }
            set { m_Content = value; }
        }
		
		int m_MemberID;
		/// <summary>
        /// 
        /// </summary>
        public int MemberID
        {
            get { return m_MemberID; }
            set { m_MemberID = value; }
        }
		
		string m_MemberName;
		/// <summary>
        /// 
        /// </summary>
        public string MemberName
        {
            get { return m_MemberName; }
            set { m_MemberName = value; }
        }
		
		DateTime m_CreateDate;
		/// <summary>
        /// 
        /// </summary>
        public DateTime CreateDate
        {
            get { return m_CreateDate; }
            set { m_CreateDate = value; }
        }
		
		bool m_IsRead;
		/// <summary>
        /// 
        /// </summary>
        public bool IsRead
        {
            get { return m_IsRead; }
            set { m_IsRead = value; }
        }
		
		DateTime? m_ReadDate;
		/// <summary>
        /// 
        /// </summary>
        public DateTime? ReadDate
        {
            get { return m_ReadDate; }
            set { m_ReadDate = value; }
        }
		
		bool m_CanReply;
		/// <summary>
        /// 
        /// </summary>
        public bool CanReply
        {
            get { return m_CanReply; }
            set { m_CanReply = value; }
        }
		
		bool m_IsReply;
		/// <summary>
        /// 
        /// </summary>
        public bool IsReply
        {
            get { return m_IsReply; }
            set { m_IsReply = value; }
        }
		
		DateTime? m_ReplyDate;
		/// <summary>
        /// 
        /// </summary>
        public DateTime? ReplyDate
        {
            get { return m_ReplyDate; }
            set { m_ReplyDate = value; }
        }
		
		string m_ReplyWay;
		/// <summary>
        /// 
        /// </summary>
        public string ReplyWay
        {
            get { return m_ReplyWay; }
            set { m_ReplyWay = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_SuggestID = reader[TableSuggest.SuggestID];
            m_Title = reader[TableSuggest.Title];
            m_Content = reader[TableSuggest.Content];
            m_MemberID = reader[TableSuggest.MemberID];
            m_MemberName = reader[TableSuggest.MemberName];
            m_CreateDate = reader[TableSuggest.CreateDate];
            m_IsRead = reader[TableSuggest.IsRead];
            m_ReadDate = reader[TableSuggest.ReadDate];
            m_CanReply = reader[TableSuggest.CanReply];
            m_IsReply = reader[TableSuggest.IsReply];
            m_ReplyDate = reader[TableSuggest.ReplyDate];
            m_ReplyWay = reader[TableSuggest.ReplyWay];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
            writer.SetPrimaryKey(TableSuggest.SuggestID, PrimaryKeyType.Identity, SuggestID);
			writer[TableSuggest.Title] = Title;
			writer[TableSuggest.Content] = Content;
			writer[TableSuggest.MemberID] = MemberID;
			writer[TableSuggest.MemberName] = MemberName;
			writer[TableSuggest.CreateDate] = CreateDate;
			writer[TableSuggest.IsRead] = IsRead;
			writer[TableSuggest.ReadDate] = ReadDate;
			writer[TableSuggest.CanReply] = CanReply;
			writer[TableSuggest.IsReply] = IsReply;
			writer[TableSuggest.ReplyDate] = ReplyDate;
			writer[TableSuggest.ReplyWay] = ReplyWay;
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
            m_SuggestID = idd;
        }
		
		public string TableName
        {
            get { return TableSuggest.Table; }
        }
		#endregion
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_SuggestID = hashToRead["SuggestID"];
			 
             m_Title = hashToRead["Title"];
			 
             m_Content = hashToRead["Content"];
			 
             m_MemberID = hashToRead["MemberID"];
			 
             m_MemberName = hashToRead["MemberName"];
			 
             m_CreateDate = hashToRead["CreateDate"];
			 
             m_IsRead = hashToRead["IsRead"];
			 
             m_ReadDate = hashToRead["ReadDate"];
			 
             m_CanReply = hashToRead["CanReply"];
			 
             m_IsReply = hashToRead["IsReply"];
			 
             m_ReplyDate = hashToRead["ReplyDate"];
			 
             m_ReplyWay = hashToRead["ReplyWay"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["SuggestID"] = SuggestID;
			 
            hashToFill["Title"] = Title;
			 
            hashToFill["Content"] = Content;
			 
            hashToFill["MemberID"] = MemberID;
			 
            hashToFill["MemberName"] = MemberName;
			 
            hashToFill["CreateDate"] = CreateDate;
			 
            hashToFill["IsRead"] = IsRead;
			 
            hashToFill["ReadDate"] = ReadDate;
			 
            hashToFill["CanReply"] = CanReply;
			 
            hashToFill["IsReply"] = IsReply;
			 
            hashToFill["ReplyDate"] = ReplyDate;
			 
            hashToFill["ReplyWay"] = ReplyWay;
			 
        }

        #endregion
		
	}
}
